package util

import (
	"net/rpc"
	"net"
	"net/rpc/jsonrpc"
)

// JSONRpcClient
// 连接成功返回 client , 失败返回错误
func GetJSONRpcClient(host string ) (client *rpc.Client, err error){
	conn, err := net.Dial("tcp", host)
	if err != nil {
		return nil ,err
	}
	// json
	client  = jsonrpc.NewClient(conn)
	return client , err

}

